import React from "react";
import { useTypedDispatch } from "@store/index";
import { addChannel } from "@slice/guestChannel";

interface Props {
  channel: Channel;
}

export default function Item({ channel }: Props) {
  const dispatch = useTypedDispatch();
  return (
    <span
      onClick={() => {
        dispatch(addChannel(channel));
      }}
    >
      {channel.name}
    </span>
  );
}
